<?php
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the Closure to execute when that URI is requested.
|
*/


// 获取注册验证码
Route::get('/api/guest/reg-code/{id?}','HomeController@getRegCode');
Route::get('/api/index/show', 'Index_ShowController@show');
Route::get('/api/index/good', 'Index_ShowController@good');
Route::get('/api/index/card', 'Index_ShowController@card');




Route::get('/send_wechat', function () {
	$result = WeixinHelper::send_unified('oUp09t6uj-31_ulp_LOS3UcMkxIk', '苏均霆,你刚刚登录了','你刚刚登录了律团网', '');
	dd($result);
});
Route::get('test', function () {
	$JpushService = \Illuminate\Support\Facades\App::make(\App\Services\JpushService::class);
	$platform = 'all';
	$audience = 'all';
	$extras =  [
		'notification_type' => 1,
		'post_id'           => 2562,
		'post_type'         => 'pay_text',
		'user_id'           => 3,
		'user_type'         => 'user',

	];
	$result = $JpushService->push($platform, $audience, '压力测试', $extras);
	return $result;
});

//打赏订单生成接口
Route::post('/order/reward', ['before' => ['auth'], 'uses' => 'Center_OrderController@orderReward']);
//免费咨询-改下路由名字
Route::post('/center/question/insert/question', ['before' => ['optional_auth'], 'uses' => 'QuestionWorkflowController@createFree']);
//问律师-创建免费咨询表单
Route::get('/question/insert/commit', array('before' => array('csrf'), 'as'=>'question.create_form','uses'=>'QuestionWorkflowController@createForm'));

//第三方登录获取回调
Route::get('/oauth/getUser','OAuthController@getUser');

//检查用户是否存在
Route::post('/check/user', 'HomeController@checkUser');
// 用户和手机号进行绑定
Route::post('/bind/phone', array('as'=>'auth.add_phone','uses'=>'HomeController@bindWithPhone') );


Route::get('/', array('as'=>'home.index','uses'=>'HomeController@index'));
Route::get('/', array('as'=>'index','uses'=>'HomeController@index'));
Route::any('index',array('as'=>'home','uses'=>'HomeController@index') );

//绑定手机
Route::get('login_json', array('as'=>'home.login_json','uses'=>'HomeController@LoginJson'));
Route::get('bind_phone', array('as'=>'home.bind_phone','uses'=>'HomeController@BindPhone'));
Route::post('bind_user_with_open_id',array('before' => array('auth'), 'as'=>'home.login.wx','uses'=>'HomeController@bindUserWithOpenId') );

//注册
Route::any('register/{uid?}',array('as'=>'home.register','uses'=>'HomeController@register') );
//第三方登陆
Route::get('login/qq',array('as'=>'login.qq','uses'=>'LoginController@loginWithQq') );
//登陆
Route::any('login',array('as'=>'home.login','uses'=>'HomeController@login') );
Route::any('loginview',  array('as'=>'home.loginview','uses'=>'HomeController@loginview') );


Route::post('loginWithWx',array('as'=>'home.login.wx','uses'=>'HomeController@loginWithWx') );

Route::post('refresh_token',array('as'=>'home.refresh_token','uses'=>'HomeController@refreshToken') );
Route::get('openid',array('as'=>'home.openid','uses'=>'HomeController@obtainOpenId') );
Route::any('logout',array('before' => array('csrf'), 'as'=>'home.logout','uses'=>'HomeController@logout') );
Route::any('check',array('as'=>'home.check','uses'=>'HomeController@checkLogin') );
Route::any('captcha',array('as'=>'home.captcha','uses'=>'CaptchaController@captcha') );

Route::get('qqlogin',array('as'=>'auth.login.qqlogin','uses'=>'LoginController@qqLoginCallback') );
Route::group(array('prefix' => 'auth'), function ()
{
	Route::get('redirectToQq',array('as'=>'auth.login.qq_redirect','uses'=>'LoginController@qqLoginRedirect') );
	// 检查一下用户是否已经登录
	Route::get('check', array('before' => array('auth'), 'as'=>'auth.check','uses'=>'AuthController@checkAuth') );
});

Route::group(array('prefix' => 'area'), function ()
{
	Route::get('addresscode/{lat}/{lng}', array('as'=>'area.addresscode', 'uses'=>'AreaController@addressCode') );
	Route::get('province',array('as'=>'area.province','uses'=>'AreaController@provinceList') );
	Route::get('{provinceId}/city',array('as'=>'area.city','uses'=>'AreaController@cityList') );
	Route::get('{cityId}/district',array('as'=>'area.district','uses'=>'AreaController@districtList') );
	Route::get('province/letters',array('as'=>'area.district','uses'=>'AreaController@provinceLetters') );
});

// 上传文件
// TODO: file upload
Route::any('file/upload/user', array('as'=>'file.upload_avatar','uses'=>'FileController@uploadUserImage'));
Route::get('file/show', array('as'=>'file.show_image','uses'=>'FileController@showImage'));
Route::any('file/upload', array('as'=>'file.upload_file','uses'=>'FileController@uploadFile'));
Route::get('file/download', array('as'=>'file.download_file','uses'=>'FileController@downloadFile'));
Route::get('file/download/{id}', array('as'=>'file.download_file_with_id','uses'=>'FileController@download'));

// 用户激活
Route::any('activation/{token}', array('as'=>'home.activation','uses'=>'HomeController@activation'));
Route::any('activeagain/{uid}', array('as'=>'home.activeagain','uses'=>'HomeController@activeagain'));
// 找回密码
Route::any('forgotpwd', array('as'=>'auth.resetpwd', 'uses'=>'AuthController@forgotPwd'));
Route::any('forgotpwd/resetpwd/{uid}', array('as'=>'auth.forgotpwd.resetpwd', 'uses'=>'AuthController@resetpwd')); //重置密码
// 注册发送验证码

Route::any('send-code', array('as'=>'send_code', 'uses'=>'HomeController@sendCode'));

// 问律师
Route::group(array('prefix' => 'question'), function ()
{	
//公益咨询
	Route::get('public/list', array('as'=>'question.public.list','uses'=>'QuestionWorkflowController@publicList'));	// 搜索已有的咨询
	Route::get('public/commit', array('as'=>'question.public.commit','uses'=>'QuestionWorkflowController@publicCommit'));	// 提交咨询
	Route::get('public/{id}/view', array('as'=>'question.public.view','uses'=>'QuestionWorkflowController@publicView'));	// 咨询详情页
	Route::get('public/reward/{id}', array('as'=>'question.public.reward','uses'=>'QuestionWorkflowController@publicReward'));//打赏支付
	Route::get('search', array('as'=>'question.search','uses'=>'QuestionWorkflowController@createFreeText'));	// 搜索已有的咨询
	
//一对一咨询
	Route::get('major/list', array('as'=>'question.major.list','uses'=>'QuestionWorkflowController@majorList'));	// 搜索专业咨询
	Route::get('text_view', array('as'=>'lawyer.text_view','uses'=>'QuestionWorkflowController@textView')); //图文咨询详情
	Route::get('phone_view', array('as'=>'lawyer.phone_view','uses'=>'QuestionWorkflowController@phoneView')); //图文咨询详情
	Route::get('fill_in_view/{id}', array('as'=>'lawyer.fill_in_view','uses'=>'QuestionWorkflowController@fillInView')); //图文咨询详情
	// TODO: file upload for question creation
	Route::post('upfiles', array('before' => array('csrf'), 'as'=>'question.upfiles','uses'=>'QuestionWorkflowController@upfiles'));  //上传附件
	
	Route::get('list', array('as'=>'question.list','uses'=>'QuestionController@listContainer'));			//跳转到问题列表界面
	Route::get('list_questions', array('as'=>'question.list_questions','uses'=>'QuestionController@listQuestions'));	//获取问题列表
	Route::any('{id}', array('before' => array('optional_auth'), 'as'=>'question.view','uses'=>'QuestionController@view'));
    
	// TODO: not used anymore?
	Route::any('{id}/similar', array('as'=>'question.similar','uses'=>'QuestionController@similar'));

	Route::group(array('before' => array('auth','csrf')), function ()
	{
	    Route::post('{id}/comment', array('as'=>'question.comment','uses'=>'CommentController@comment'));
	    Route::post('comment/{id}/remove', array('as' => 'question.comment.remove', 'uses' => 'CommentController@remove'));  //删除评论
	    Route::get('{postId}/comment_list', array('as' => 'question.comment_list', 'uses' => 'CommentController@commentList') );
	});
});

// 微信支付接口
Route::group(array('prefix' => 'payment'), function ()
{
	Route::get('display', array('as'=>'payment.display','uses'=>'PaymentController@displayQrCode'));
	Route::post('notify', array('as'=>'payment.notify','uses'=>'PaymentController@notify'));
	Route::get('jsapiparams/{openid}/{attach}', array('as'=>'payment.jsapiparams','uses'=>'PaymentController@jsApiParameters'));
  	Route::get('query/{out_trade_no}', array('as'=>'payment.query','uses'=>'PaymentController@query'));
  	Route::get('success/{out_trade_no}', array('as'=>'payment.success','uses'=>'PaymentController@success'));
  	Route::get('qrparams/{attach}', array('as'=>'payment.qr_params','uses'=>'PaymentController@qrParams'));
});

// 通用支付接口
Route::group(array('prefix' => 'payment_gateway'), function ()
{
	Route::get('query/{chid}', array('as'=>'payment.query','uses'=>'Payment_GatewayController@query'));
	Route::post('charge', array('as'=>'payment.charge','uses'=>'Payment_GatewayController@charge'));
	Route::any('charge_succeeded', array('as'=>'payment.charge.succeed','uses'=>'Payment_GatewayController@chargeSucceeded'));
	Route::any('backUpacp1','Payment_GatewayController@backUpacp1');//后台通知
});

//钱包接口
Route::group(array('before' => array('auth','csrf'), 'prefix' => 'wallet'), function(){
//	Route::post('/pay', array('as' => 'wallet.pay', 'uses' => 'WalletController@pay'));
// 	Route::post('recharge', array('as' => 'wallet.recharge', 'uses' => 'WalletController@recharge'));		//充值
	Route::post('withdraw', array('as' => 'wallet.withdraw', 'uses' => 'WalletController@withdraw'));	//钱包提现
	Route::post('reward', array('as' => 'wallet.reward', 'uses' => 'WalletController@reward'));		//送心意
	Route::get('record', array('as' => 'wallet.record', 'uses' => 'WalletController@rechargeRecord')); //流水记录查询
});
	
// 找律师
Route::group(array('prefix' => 'lawyer'), function ()
{	

	Route::get('practiseperiods', array('as'=>'lawyer.practiseperiods','uses'=>'LawyerController@practisePeriods')); // 律师的专长
	Route::get('workscopes', array('as'=>'lawyer.workscopes','uses'=>'LawyerController@workscopes')); // 律师的专长
	Route::get('cities', array('as'=>'lawyer.city','uses'=>'LawyerController@getCitiesFromLawyer')); // 律师的城市
	
	Route::get('evaluations', array('as'=>'lawyer.all_evaluations','uses'=>'LawyerController@allEvaluations')); // 对所有律师的评价
	Route::get('list', array('as'=>'lawyer.list','uses'=>'LawyerController@listContainer')); // 律师页面
	Route::get('list_lawyers', array('as'=>'lawyer.list_lawyers','uses'=>'LawyerController@listLawyers')); // 律师列表
	Route::get('search', array('as'=>'lawyer.search','uses'=>'LawyerController@search')); // 展示一个搜索框
	Route::get('articles', array('as'=>'lawyer.all_articles','uses'=>'LawyerController@allArticles'));  //律师最新文章
	Route::get('{id}', array('before' => array('token_auth','basic_auth'), 'as'=>'lawyer.view','uses'=>'LawyerController@view')); //律师的主页
    Route::get('{id}/articles', array('as'=>'lawyer.articles','uses'=>'LawyerController@articles')); //律师文章分享
    Route::get('article/{id}/view', array('as'=>'lawyer.article_view','uses'=>'LawyerController@viewArticle')); //文章内容
    // Route::get('/{id}/comments/{type?}', array('as'=>'lawyer.comment','uses'=>'LawyerController@comments')); //律师评论
	Route::get('{id}/questions', array('as'=>'lawyer.questions','uses'=>'LawyerController@questions')); //律师咨询和回复
    Route::get('{id}/orders', array('as'=>'lawyer.orders','uses'=>'LawyerController@orders')); // 律师的交易
	Route::get('{id}/cases', array('as'=>'lawyer.cases','uses'=>'LawyerController@cases')); // 律师的案件
	Route::get('{id}/evaluations', array('as'=>'lawyer.evaluations','uses'=>'LawyerController@evaluations')); // 对某个律师的评价
	Route::get('{id}/deals', array('as'=>'lawyer.deals','uses'=>'LawyerController@deals')); // 律师的成交记录
});

// 用户中心
Route::group(array('before' => array('auth','csrf'), 'prefix' => 'center'), function ()
{
	foreach(['center','customer','lawyer','company'] as $ctl) { //controllers 
		foreach([
				 'index'=>'',
				 ] as $act => $param) { //actions
			Route::any( $ctl.'/'.$act.$param, ['as'=>$ctl.'.'.$act, 'uses'=> ucfirst($ctl).'Controller@'.$act] );
		}
	}
	
	// 更改用户信息
	Route::get('welcome/{account_type}', ['as'=>'center.welcome','uses'=>'CenterController@welcome']);
	Route::any('info', ['as'=>'center.info','uses'=>'CenterController@info']);
	Route::get('wallet/moneyin', ['as'=>'center.wallet.moneyin','uses'=>'WalletController@walletMoneyIn']); // 我的钱包-充值
	Route::get('lawyer/wallet/moneyin', ['as'=>'center.lawyer.wallet.moneyin','uses'=>'WalletController@walletMoneyIn']); // 我的钱包-充值 (律师)
	Route::get('wallet/moneyout', ['as'=>'center.wallet.moneyout','uses'=>'WalletController@walletMoneyOut']); // 我的钱包-提现
	Route::get('lawyer/wallet/moneyout', ['as'=>'center.lawyer.wallet.moneyout','uses'=>'WalletController@walletMoneyOut']); // 我的钱包-提现
	Route::get('{user_id}/reward', array('as'=>'center.wallet.reward','uses'=>'WalletController@walletReward')); // 送心意
	Route::any('update_phone', array('as'=>'center.update_phone', 'uses'=>'CenterController@updatePhone')); // 更新电话
	Route::any('update_email', array('as'=>'center.update_email', 'uses'=>'CenterController@updateEmail')); // 更新邮箱
	
	// TODO: file upload
	Route::any('update_user_image', ['as'=>'center.update_user_image','uses'=>'CustomerCenterController@updateUserImage']);
	
	Route::get('collect', array('as'=>'center.collect','uses'=>'CenterController@collect')); // 我的收藏
	Route::any('reset_pass', array('as'=>'center.reset_pass','uses'=>'CenterController@resetPass')); // 重置密码
	Route::get('blog/reply', array('as'=>'center.blog.replies','uses'=>'CenterController@blogReply')); // 我的跟贴
	
	// 我的订单
		// 已完成，未完成，待评价，购物车
	Route::get('mywallet', array('as' => 'center.mywallet', 'uses' => 'centerController@myWallet'));
	Route::get('order/cart', array('as'=>'center.order.cart','uses'=>'CenterController@orderCart')); // 我的订单-待付款
	Route::get('order/incomplete', array('as'=>'center.order.incomplete','uses'=>'CenterController@orderIncomplete')); // 我的订单-已付款，未完成
	Route::get('order/waitforcomment', array('as'=>'center.order.waitforcomment','uses'=>'CenterController@orderWaitForComment')); // 我的订单-已完成，未评价
	Route::get('order/complete', array('as'=>'center.order.complete','uses'=>'CenterController@orderComplete')); // 我的订单-已付款，已完成
	Route::get('order/{id}/view', array('as'=>'center.order.view','uses'=>'CenterController@view')); //订单详情
	
	// 成为律师
	Route::group(array('prefix' => 'becomelawyer'), function() {
		Route::any('work', array('as'=>'center.becomelawyer.work','uses'=>'BecomeLawyerController@lawyerWorkInfo'));
		Route::any('identity', array('as'=>'center.becomelawyer.identity','uses'=>'BecomeLawyerController@lawyerIdentityInfo'));
		Route::any('fee', array('as'=>'center.becomelawyer.fee','uses'=>'BecomeLawyerController@lawyerFeeInfo'));
		Route::any('workscope', array('as'=>'center.becomelawyer.workscope','uses'=>'BecomeLawyerController@lawyerWorkScopeInfo'));
		Route::any('experience', array('as'=>'center.becomelawyer.experience','uses'=>'BecomeLawyerController@lawyerExperienceInfo'));
		Route::post('submit', array('as'=>'center.becomelawyer.submit','uses'=>'BecomeLawyerController@becomelawyer'));
		Route::get('infochecks', array('as'=>'center.becomelawyer.infochecks','uses'=>'BecomeLawyerController@lawyerInfoChecks'));
	});
	Route::any('become_lawyer', array('before'=>'customer','as'=>'center.customer.become_lawyer','uses'=>'CustomerCenterController@becomeLawyer')); // 成为律师

	Route::group(array('prefix' => 'order'), function() {
	    // 代付款订单列表
	    Route::get('list', array('as'=>'center.order.list', 'uses'=>'Center_OrderController@listOrders'));
	});
	
	Route::group(array('prefix' => 'question'), function() {
		// 咨询列表
		Route::get('list', array('as'=>'center.question.list', 'uses'=>'Center_QuestionController@listQuestions'));
		
		// 咨询详情
		Route::get('{id}/view', array('as'=>'center.question.view', 'uses'=>'Center_QuestionController@viewItem'));
		
   	    // 咨询状态改变
			// 普通用户
		Route::get('{id}/evaluate', array('as'=>'center.question.to_evaluate','uses'=>'CustomerCenterController@evaluate'));		// 去评价咨询
		
		Route::post('create/{type}', array('as'=>'center.question.create','uses'=>'QuestionWorkflowController@create'));
		Route::get('{id}/ask',array('as'=>'center.question.to_ask','uses'=>'QuestionWorkflowController@ask'));		// 联系律师或客户
		Route::post('{id}/confirm', array('as'=>'center.question.to_confirm','uses'=>'QuestionWorkflowController@confirm'));		// 完成咨询
		Route::post('{id}/evaluate', array('as'=>'center.question.to_evaluate','uses'=>'QuestionWorkflowController@evaluate'));		// 评价咨询
		Route::post('{id}/tip', array('as'=>'center.question.to_tip','uses'=>'QuestionWorkflowController@tip'));		// 评价咨询
		Route::post('{id}/cancel', array('as'=>'center.question.to_cancel','uses'=>'QuestionWorkflowController@cancel')); // 取消我的咨询
		Route::post('{id}/remove', array('as'=>'center.question.to_remove','uses'=>'QuestionWorkflowController@remove')); // 律師咨询-删除
		
			// 律师
		Route::post('{id}/take', array('as'=>'center.question.to_take','uses'=>'QuestionWorkflowController@take'));	// 咨询抢单
		Route::post('{id}/accept', array('as'=>'center.question.to_accept','uses'=>'QuestionWorkflowController@accept')); // 律師咨询-受理
		Route::post('{id}/refuse', array('as'=>'center.question.to_refuse','uses'=>'QuestionWorkflowController@refuse')); // 律師咨询-拒绝
		
		    // 商品
		Route::post('{id}/pay/wallet', array('as' => 'center.question.pay.wallet', 'uses' => 'Center_OrderController@walletPay'));		//钱包支付
		// Route::post('{id}/pay/money', array('as' => 'center.question.pay.money', 'uses' => 'Center_OrderController@moneyPay'));		//直接支付
	});
});

// 普通用户的用户中心
Route::group(array('before' => array('auth', 'csrf'), 'prefix' => 'center'), function ()
{
	Route::get('/question_order/question/{status}', array('as'=>'center.customer.question_order.free_question','uses'=>'CustomerCenterController@freeQuestion')); // 免费咨询
	Route::get('/question_order/pay_text/{status}', array('as'=>'center.customer.question_order.pay_text','uses'=>'CustomerCenterController@payText')); // 图文咨询
	Route::get('/question_order/pay_phone/{status}', array('as'=>'center.customer.question_order.pay_phone','uses'=>'CustomerCenterController@payPhone')); // 电话咨询
	Route::get('/question_order/pay_company/{status}', array('as'=>'center.customer.question_order.pay_company','uses'=>'CustomerCenterController@payCompany')); // 法律顾问咨询
	Route::get('/question_order/{id}/to_pay', array('as'=>'center.customer.question_order.to_pay','uses'=>'MyOrderController@toPay')); // 我的商品-去付款
	Route::get('/question_order/{id}/view', array('as'=>'center.customer.question_order.view','uses'=>'CustomerCenterController@orderView')); // 详情
	Route::get('/customer/my_order', array('as'=>'center.customer.my_order','uses'=>'CustomerCenterController@myOrder')); // 我的订单
	// (免费咨询)我的咨询
	Route::get('/question/my_question', array('as'=>'center.customer.my_question','uses'=>'CustomerCenterController@myQuestion')); // 我的咨询
	Route::get('/question/all', array('as'=>'center.customer.question.all','uses'=>'CustomerCenterController@questionAll')); // 我的咨询-全部
	Route::get('/question/new', array('as'=>'center.customer.question.new','uses'=>'CustomerCenterController@questionNew')); // 我的咨询-未抢单咨询
	Route::get('/question/replied', array('as'=>'center.customer.question.replied','uses'=>'CustomerCenterController@questionReplied')); // 我的咨询-已受理
	Route::get('/question/waitforevaluation', array('as'=>'center.customer.question.waitforevaluation','uses'=>'CustomerCenterController@questionWaitForEvaluation')); // 我的咨询-待评价
	Route::get('/question/complete', array('as'=>'center.customer.question.complete','uses'=>'CustomerCenterController@questionComplete')); // 我的咨询-已完成
	Route::get('/question/cancelled', array('as'=>'center.customer.question.cancelled','uses'=>'CustomerCenterController@questionCancelled')); // 我的咨询-已取消
	Route::get('/question/{id}/viewquestion', array('as'=>'center.customer.question.view','uses'=>'CustomerCenterController@questionView')); // 我的咨询-咨询详情

	// (付费咨询) 我的订单
	Route::group(array('prefix' => 'pay'), function(){
		Route::post('/question/create', array('as'=>'pay.center.customer.question.create','uses'=>'MyOrderController@create')); // 我的咨询-创建
		Route::get('/question/all', array('as'=>'pay.center.customer.question.all','uses'=>'MyOrderController@all')); // 我的咨询-全部
		Route::get('/question/waitpay', array('as'=>'pay.center.customer.question.waitpay','uses'=>'MyOrderController@waitPay')); // 我的咨询-未付款
		// Route::get('/question/{id}/to_pay', array('as'=>'pay.center.customer.question.to_pay','uses'=>'MyOrderController@toPay')); // 我的咨询-去付款
		Route::get('/question/new', array('as'=>'pay.center.customer.question.new','uses'=>'MyOrderController@questionNew')); // 我的咨询-未抢单咨询
		Route::get('/question/replied', array('as'=>'pay.center.customer.question.replied','uses'=>'MyOrderController@questionReplied')); // 我的咨询-已受理
		Route::get('/question/waitforevaluation', array('as'=>'pay.center.customer.question.waitforconfirmation','uses'=>'MyOrderController@waitforEvaluation')); // 我的咨询-待评价
		Route::get('/question/complete', array('as'=>'pay.center.customer.question.complete','uses'=>'MyOrderController@questionComplete')); // 我的咨询-已完成
		Route::get('/question/cancelled', array('as'=>'pay.center.customer.question.cancelled','uses'=>'MyOrderController@questionCancelled')); // 我的咨询-已取消
		Route::get('/question/refused', array('as'=>'pay.center.customer.question.refused','uses'=>'MyOrderController@questionRefused')); // 我的咨询-已拒绝
		Route::get('/question/{id}/view', array('as'=>'pay.center.customer.question.view','uses'=>'MyOrderController@view')); // 我的咨询-咨询详情
		Route::get('/order/{id}/view', array('as'=>'pay.center.customer.order.view','uses'=>'MyOrderController@viewOrder')); // 我的订单-订单详情
	});

	// 我的律师
	Route::group(array('prefix' => 'mylawyer'), function(){
	    Route::get('ordered', array('as'=>'center.customer.lawyer_order','uses'=>'CustomerCenterController@lawyerOrdered')); // 我的律师-已经有订单
		Route::get('followed', array('as'=>'center.customer.lawyer_follow','uses'=>'CustomerCenterController@lawyerFollowed')); // 我的律师-已经关注
		Route::get('consulted', array('as'=>'center.customer.lawyer_consult','uses'=>'CustomerCenterController@lawyerConsulted')); // 我的律师-已经咨询
	});
	
	Route::get('/score/list_scores', array('as'=>'center.customer.score','uses'=>'ScoreHistoryController@listScores')); // 我的积分
	Route::any('customer/info', ['as'=>'center.customer.info','uses'=>'CustomerCenterController@info']);
	Route::any('customer/update_user_image', ['as'=>'center.customer.update_user_image','uses'=>'CustomerCenterController@updateUserImage']);
	Route::any('customer/update_lawyer_bgimage', ['as'=>'center.customer.update_lawyer_bgimage','uses'=>'CustomerCenterController@updateLawyerBgImage']);
	Route::any('customer/commodity', ['as'=>'center.customer.commodity','uses'=>'CustomerCenterController@customerCommodity']);
	Route::get('customer/wallet', ['as'=>'center.customer.wallet','uses'=>'WalletController@myWallet']); // 我的钱包
});

// 律师的用户中心
Route::group(array('before' => array('csrf', 'auth', 'lawyer'), 'prefix' => 'center'), function ()
{

	Route::get('/lawyer/question_order/question/{status}', array('as'=>'center.lawyer.question_order.free_question','uses'=>'LawyerCenterController@freeQuestion')); // 免费咨询
	Route::get('/lawyer/question_order/pay_text/{status}', array('as'=>'center.lawyer.question_order.pay_text','uses'=>'LawyerCenterController@payText')); // 图文咨询
	Route::get('/lawyer/question_order/pay_phone/{status}', array('as'=>'center.lawyer.question_order.pay_phone','uses'=>'LawyerCenterController@payPhone')); // 电话咨询
	Route::get('/lawyer/question_order/pay_company/{status}', array('as'=>'center.lawyer.question_order.pay_company','uses'=>'LawyerCenterController@payCompany')); // 法律顾问咨询
	Route::get('/lawyer/question_order/{id}/view', array('as'=>'center.lawyer.question_order.view','uses'=>'LawyerCenterController@orderView')); // 详情
	Route::get('/lawyer/my_order', array('as'=>'center.lawyer.my_order','uses'=>'LawyerCenterController@myOrder')); // 我的订单
	
	Route::get('/lawyer/my_question', array('as'=>'center.lawyer.my_question','uses'=>'LawyerCenterController@myQuestion')); // 咨询管理
	Route::get('/lawyer/score/list_scores', array('as'=>'center.lawyer.score','uses'=>'ScoreHistoryController@listScores')); // 我的积分
	Route::get('/lawyer/blog/reply', array('as'=>'center.lawyer.blog.reply','uses'=>'LawyerCenterController@blogReply')); // 我的跟贴
	Route::any('lawyer/wallet', ['as'=>'center.lawyer.wallet','uses'=>'WalletController@myWallet']); // 我的钱包
	Route::any('/lawyer/reset_pass', array('as'=>'center.lawyer.reset_pass','uses'=>'LawyerCenterController@resetPass')); // 重置密码
	Route::any('/lawyer/become_lawyer', array('before'=>'customer','as'=>'center.lawyer.become_lawyer','uses'=>'LawyerCenterController@becomeLawyer')); // 成为律师
		// 我的客户
			// 已成交，已关注，已咨询
	Route::get('/lawyer/customer/followed', array('as'=>'center.lawyer.customer.followed','uses'=>'LawyerCenterController@customerFollowed')); // 已关注我的人
	Route::get('/lawyer/customer/consulted', array('as'=>'center.lawyer.customer.consulted','uses'=>'LawyerCenterController@customerConsulted')); // 已咨询过我的人
	Route::get('/lawyer/customer/ordered', array('as'=>'center.lawyer.customer.ordered','uses'=>'LawyerCenterController@customerOrdered')); // 已和我有成交的人

	// (免费咨询)律師的咨询未回复，已回复 
	Route::get('/lawyer/question/all', array('as'=>'center.lawyer.question.all','uses'=>'LawyerCenterController@questionAll')); // 律師咨询-所有
	Route::get('/lawyer/question/new', array('as'=>'center.lawyer.question.new','uses'=>'LawyerCenterController@questionNew')); // 律師咨询-推送但未被抢单
	Route::get('/lawyer/question/replied', array('as'=>'center.lawyer.question.replied','uses'=>'LawyerCenterController@questionReplied')); // 律師咨询-待确认
	Route::get('/lawyer/question/complete', array('as'=>'center.lawyer.question.complete','uses'=>'LawyerCenterController@questionComplete')); // 律師咨询-已完成
	Route::get('/lawyer/question/{id}/view', array('as'=>'center.lawyer.question.view','uses'=>'LawyerCenterController@questionView')); // 律師咨询-咨询详情
	
	// （付费咨询）律師的咨询未回复，已回复 /replied /unreplied/回收站
	Route::group(array('prefix' => 'pay'), function(){
		Route::get('/lawyer/question/all', array('as'=>'center.pay.lawyer.question.all','uses'=>'LawyerOrderController@questionAll')); // 律師咨询-全部
		Route::get('/lawyer/question/new', array('as'=>'center.pay.lawyer.question.new','uses'=>'LawyerOrderController@questionNew')); // 律師咨询-推送但未受理
		Route::get('/lawyer/question/replied', array('as'=>'center.pay.lawyer.question.replied','uses'=>'LawyerOrderController@questionReplied')); // 律師咨询-待确认
		Route::get('/lawyer/question/complete', array('as'=>'center.pay.lawyer.question.complete','uses'=>'LawyerOrderController@questionComplete')); // 律師咨询-已完成
		Route::get('/lawyer/question/cancelled', array('as'=>'center.pay.lawyer.question.cancelled','uses'=>'LawyerOrderController@questionCancelled')); // 律師咨询-已取消
		Route::get('/lawyer/question/refused', array('as'=>'center.pay.lawyer.question.refused','uses'=>'LawyerOrderController@questionRefused')); // 律師咨询-已拒绝
		Route::get('/lawyer/question/{id}/view', array('as'=>'center.pay.lawyer.question.view','uses'=>'LawyerOrderController@view')); // 律師咨询-咨询详情
		
		Route::post('/lawyer/question/{id}/accept', array('as'=>'center.pay.lawyer.question.accept','uses'=>'LawyerOrderController@accept')); // 律師咨询-受理
		Route::post('/lawyer/question/{id}/refuse', array('as'=>'center.pay.lawyer.question.refuse','uses'=>'LawyerOrderController@refuse')); // 律師咨询-拒绝
	});
	Route::get('/lawyer/question/{id}/evaluate/view',array('as'=>'center.lawyer.question.evaluate.view','uses'=>'LawyerCenterController@evaluateView'));	//查看评价
	Route::post('/lawyer/question/{id}/remove', array('as'=>'center.pay.lawyer.question.refuse','uses'=>'LawyerOrderController@questionRemove')); // 律師咨询-删除
	Route::get('/lawyer/question/{id}/ask',array('as'=>'center.lawyer.question.ask','uses'=>'QuestionWorkflowController@ask'));	//联系客户
	
	Route::get('/lawyer/blog/list', array('as'=>'center.lawyer.blog.list','uses'=>'LawyerCenterController@blogList')); // 律師发布的帖子
	Route::any('/lawyer/blog/create', array('as'=>'center.lawyer.blog.create','uses'=>'LawyerCenterController@blogCreate')); // 律師发布新帖
	Route::get('/lawyer/blog/draft', array('as'=>'center.lawyer.blog.draft','uses'=>'LawyerCenterController@blogDraft')); // 律師草稿箱
	Route::get('/lawer/blog/{id}/remove', array('as' => 'center.lawyer.blog.remove', 'uses'=>'LawyerCenterController@blogRemove'));//删除
	Route::get('/lawer/blog/{id}/edit', array('as' => 'center.lawyer.blog.edit', 'uses'=>'LawyerCenterController@blogEdit'));	//修改 
	Route::get('/lawer/blog/{id}/blogview', array('as' => 'center.lawyer.blog.view', 'uses'=>'LawyerCenterController@blogView'));	//详情	

	// 律师的收藏
	Route::get('/lawyer/collect', array('as'=>'center.lawyer.collect','uses'=>'CenterController@collect')); 
	Route::get('/lawyer/collect/{id}/delete', array('as'=>'center.lawyer.collect.delete','uses'=>'CenterController@deleteCollect')); 
	// 律师的圈子
	Route::get('/lawyer/group', array('as'=>'center.lawyer.group','uses'=>'LawyerCenterController@group')); 
	
	// 我的个人信息
	Route::any('/lawyer/become_lawyer', array('as'=>'center.lawyer.become_lawyer','uses'=>'LawyerCenterController@becomeLawyer')); // 成为律师
	Route::any('/lawyer/info', array('as'=>'center.lawyer.info','uses'=>'LawyerCenterController@info')); 
	Route::any('/lawyer/main', array('as'=>'center.lawyer.main','uses'=>'LawyerCenterController@main')); 
});

// 收藏
Route::post('/collect', array('before' => array('csrf', 'auth'), 'as'=>'collect', 'uses'=>'CollectController@add'));
Route::post('/collect/delete', array('before' => array('csrf', 'auth'), 'as'=>'collect.delete', 'uses'=>'CollectController@delete'));


// 文章评论
Route::group(array('prefix' => 'article'), function ()
{
//	Route::get('/{id}', array('as'=>'article.view','uses'=>'ArticleController@view')); //律师文章分享详情
	Route::post('/{id}/comment', array('before' => array('auth','csrf'), 'as'=>'article.comment','uses'=>'ArticleController@comment')); //律师文章评价
	Route::get('/{id}/comment/list', array( 'as'=>'article.comment/list','uses'=>'ArticleController@commentList')); //律师文章评价列表	
});

// 案例
Route::group(array('prefix' => 'case', 'before' => array('token_auth','basic_auth','csrf')), function ()
{
	Route::get('/search', array('as'=>'case.search','uses'=>'CaseController@search')); //搜案例
	Route::get('/list', array('as'=>'case.list','uses'=>'CaseController@listContainer')); //搜案例
	Route::get('/list_case', array('as'=>'case.list_case','uses'=>'CaseController@listCase')); //案例列表
	Route::get('/{id}/view', array('as'=>'case.view','uses'=>'CaseController@view')); //律师案例详情
});

// 看新闻
Route::group(array('before' => array('token_auth','basic_auth'), 'prefix' => 'news'), function ()
{
	Route::get('/list', array('as'=>'news.list','uses'=>'NewsController@listContainer')); // 知识列表
	Route::get('/list_news', array('as'=>'news.list_news','uses'=>'NewsController@listNews')); //新闻列表
	Route::get('/{id}/view', array('as'=>'news.view','uses'=>'NewsController@view')); //新闻详情
});

// 网站信息
Route::group(array('prefix' => 'siteinfo'), function ()
{
	Route::get('/list_siteinfo', array('as'=>'siteinfo.list_siteinfo','uses'=>'SiteInfoController@listSiteInfo')); // 网站信息列表
	Route::get('/{id}/view', array('as'=>'siteinfo.view','uses'=>'SiteInfoController@view')); // 网站信息详情
});

// 学知识
Route::group(array('before' => array('token_auth','basic_auth'), 'prefix' => 'knowledge'), function ()
{
	//文书下载
	Route::get('document/list', array('as'=>'knowledge.document','uses'=>'KnowledgeController@documentListContainer')); //文书下载页面(pc)
	Route::get('document/list_documents', array('as'=>'knowledge.download_list','uses'=>'KnowledgeController@listDocument')); //文书下载列表(公共获取列表)
	Route::get('document/{id}/view', array('as'=>'knowledge.document_view','uses'=>'KnowledgeController@viewDocument')); //文书详细
	Route::post('document/{id}/download', array('as' => 'knowledge.document_download', 'uses' => 'KnowledgeController@download')); //下载数量统计
	Route::get('document/categories', array('as'=>'knowledge.document_categories','uses'=>'KnowledgeController@documentCategories'));
	
	
	//法律文库
	Route::get('/article/{id}/view', array('as'=>'knowledge.article_view','uses'=>'KnowledgeController@viewLibraryArticle')); //法律文库
	Route::get('/article/list_articles', array('as'=>'knowledge.article_list','uses'=>'KnowledgeController@listArticle')); //法律文库

	//知识（包括了案例和文库）
	Route::get('/list_knowledge', array('as'=>'knowledge.knowledge_list','uses'=>'KnowledgeController@listKnowledge')); //知识列表

	Route::get('/{id}/view', array('as'=>'knowledge.view','uses'=>'KnowledgeController@view')); //法律文库

	Route::get('/weekly', array('as'=>'knowledge.weekly', 'uses'=>'KnowledgeController@getWeeklyHotArticles')); // 一周热文
	Route::get('/most_liked', array('as'=>'knowledge.most_liked', 'uses'=>'KnowledgeController@getMostLikedArticles')); // 推荐
	Route::get('/latest', array('as'=>'knowledge.latest', 'uses'=>'KnowledgeController@getLatestNewsItem')); // 最新的
	
	Route::get('/list', array('as'=>'knowledge.list','uses'=>'KnowledgeController@listContainer')); // 知识列表

});

// 人才交流
Route::group(array('prefix' => 'hr'), function ()
{
	Route::get('/list_positions', array('as'=>'hr.list','uses'=>'HrController@listPositions')); // 职位列表
	Route::get('/{id}/view', array('as'=>'hr.view','uses'=>'HrController@viewPosition')); // 职位详情
});

// 律团联盟
Route::group(array('prefix' => 'union'), function ()
{
	Route::get('/list_partners', array('as'=>'hr.list','uses'=>'UnionController@listPartners')); // 伙伴列表
	Route::get('/{id}/view', array('as'=>'hr.view','uses'=>'UnionController@viewPartner')); // 伙伴详情
});


// 做公益
Route::group(array('prefix' => 'charity'), function ()
{
	Route::get('/', array('as'=>'charity.index','uses'=>'ComingController@index'));
});

// 站内信
Route::group(array('prefix' => 'letter'), function ()
{
    Route::get('/sys', array('before'=>'auth', 'as'=>'letter.sys','uses'=>'LetterController@sys'));				//查看系统信息列表
    Route::post('send/{id}', array('before'=>'auth', 'as'=>'letter.send','uses'=>'LetterController@send'));		//发送信息
    Route::post('{id}/delete', array('before'=>'auth', 'as'=>'letter.delete','uses'=>'LetterController@delete'));		//删除信息
    Route::get('users', array('before'=>'auth', 'as'=>'letter.users','uses'=>'LetterController@users'));		//查看用户信息列表
    Route::get('user-letters/{id}', array('before'=>'auth', 'as'=>'letter.user_letters','uses'=>'LetterController@user_letters'));
    Route::get('sys-letters/{id}', array('before'=>'auth', 'as'=>'letter.sys_letters','uses'=>'LetterController@sys_letters'));
});

// 圈子
Route::group(array('before' => array('auth','csrf','lawyer'), 'prefix' => 'group'), function ()
{
	Route::get('/create', array('as'=>'group.create','uses'=>'SNSController@create'));				// 创建圈子请求(获取可添加成员列表)
	Route::post('/store', array('as'=>'group.store','uses'=>'SNSController@store'));					// 保存创建的圈子
	
	// TODO: file upload
	Route::post('/uploadImage', array('as'=>'group.upload_image','uses'=>'SNSController@upload_image'));	//上传圈子头像
	
	Route::get('/recommend', array('as'=>'group.recommend','uses'=>'SNSController@recommend')); 		// 推荐的圈子列表
	Route::get('/list/mine', array('as'=>'group.list.mine','uses'=>'SNSController@mine')); 			// 我的圈子列表
	Route::get('/{groupId}/chat', array('as'=>'group.chat','uses'=>'SNSController@chat'));		// 圈子聊天内页
	Route::get('/{groupId}/detail', array('as'=>'group.detail','uses'=>'SNSController@detail'));		// 圈子详细
	Route::post('/{groupId}/edit',array('as' => 'group.edit', 'uses' =>'SNSController@edit' ));		// 设置圈子
	Route::get('/{groupId}/listmembers',array('as' => 'group.listmembers', 'uses' =>'SNSController@listMembers' ));		// 罗列圈子成员
	Route::any('/{groupId}/addmember',array('as' => 'group.addmember', 'uses' =>'SNSController@addMember' ));		// 圈子管理员添加成员
	Route::get('/{groupId}/removemember/{userId}',array('as' => 'group.removemember', 'uses' =>'SNSController@removeMember' ));		// 圈子管理员删除某个成员
	Route::post('/{groupId}/removemembers',array('as' => 'group.removemembers', 'uses' =>'SNSController@removeMembers' ));		// 圈子管理员删除多个成员
	Route::post('/{groupId}/join', array('as'=>'group.join', 'uses'=>'SNSController@join'));			// 关注一个圈子
	Route::get('/{groupId}/quit', array('as'=>'group.quit', 'uses'=>'SNSController@quit'));			// 离开一个圈子
	Route::get('/{groupId}/dissolution', array('as' =>'group.dissolution', 'uses' => 'SNSController@dissolution'));//解散一个圈子
	Route::get('/{groupId}/records', array('as'=>'group.chatrecords', 'uses'=>'SNSController@chatRecords'));
});

// utils
Route::any('common/wxconfig/{callback?}/{debug?}', array('as'=>'common.wxconfig', 'uses'=>'CommonController@wxconfig') );
Route::any('wx/oauth', array('as'=>'weixin.oauth', 'uses'=>'WeixinController@oauth') );
Route::any('evaluate/tags', array('as'=>'evaluate.tags', 'uses'=>'QuestionController@evaluateTags') );

//微信
Route::any('weixin/oauth', array('as'=>'weixin.oauth', 'uses'=>'WeixinController@oauth') );
Route::any('weixin/index', array('as'=>'weixin.index', 'uses'=>'WeixinController@index') );

// 知识
Route::group(array('prefix' => 'info'), function ()
{
    Route::get('/{cat?}', array('as'=>'info.index','uses'=>'InfoController@index'));
	Route::get('detail/{id}', array('as'=>'info.detail','uses'=>'InfoController@detail'));
	Route::get('lawyers/{law_cat}', array('as'=>'info.lawyer','uses'=>'InfoController@lawyers'));
});

Route::get('coming', array('as'=>'coming','uses'=>'ComingController@index'));

// Route::any('common/area/{code?}', array('as'=>'common.area', 'uses'=>'CommonController@area') );



// 法律顾问
Route::group(array('prefix' => 'company'), function(){
	Route::get('/store/adviser1', array('as' => 'store.adviser1', 'uses' => 'StoreController@storeAdviser1'));
	Route::get('/store/adviser2', array('as' => 'store.adviser2', 'uses' => 'StoreController@storeAdviser2'));
	Route::get('/store/adviser3', array('as' => 'store.adviser3', 'uses' => 'StoreController@storeAdviser3'));

	Route::get('/product/list', array('as' => 'company.server', 'uses' => 'StoreController@listProducts'));
	Route::any('/product/{id}/view', array('before' => array('csrf'), 'as'=>'product.view', 'uses'=>'StoreController@view') );
	// Route::post('/order/submit', array('before' => array('auth','csrf'), 'as' => 'order.submit', 'uses' => 'MyOrderController@submitOrder'));
	Route::get('/product/{id}/comments', array('as' =>'company.product.comment','uses'=>'StoreController@productComments'));    //产品评价列表
});

//动态
Route::group(array('before' => array('auth', 'csrf'),'prefix' => 'microblog'),function(){
	Route::any('/create', array('as'=>'microblog.create','uses'=>'MicroblogController@create'));
	Route::post('/forward',array('as'=>'microblog.forward','uses'=> 'MicroblogController@forward'));
	Route::get('/{post_id}/view', array('as'=>'microblog.view','uses'=>'MicroblogController@view'));
	Route::get('/{post_id}/delete', array('as'=>'microblog.delete','uses'=>'MicroblogController@delete'));
	Route::get('/list/all', array('as'=>'microblog.list.all','uses'=>'MicroblogController@microBlogListAll'));
	Route::get('/list/mine', array('as'=>'microblog.list.mine','uses'=>'MicroblogController@microBlogListMine'));
	Route::post('/{post_id}/comment/create',array('as'=>'microblog.comment','uses'=> 'MicroblogController@createComment'));   //评论动态
	
	// TODO: file upload
	Route::post('/uploadImage/{field_name?}',array('as' => 'microblog.upload_image','uses' => 'MicroblogController@uploadImage'));
});

//关注
Route::group(array('before' => 'auth','prefix' => 'follow'),function(){
	Route::post('/',array('as' => 'follow','uses' => 'FollowController@follow'));  //关注
	Route::post('/remove',array('as' => 'follow.remove','uses' => 'FollowController@followRemove'));  //取消关注
});

//点赞
Route::post('/like', array('before' => 'auth', 'as' => 'like', 'uses'=>'LikeController@like'));

//即时通信(参考用)
Route::group(array('before' => array('auth','csrf'),'prefix' => 'easemob'),function(){
	Route::any('/login', array('as' => 'easemob.login','uses' =>'EasemobController@login'));								//登录环信(demo)
	Route::any('/editpwd', array('as' => 'easemob.editpwd','uses' =>'EasemobController@editPassword'));						//重置密码
	Route::get('/users', array('as'=>'easemob.users', 'uses'=>'EasemobController@easemob'));  								//查看本网站已注册环信用户列表
	Route::get('/noeasemob', array('as'=>'easemob.noeasemob', 'uses'=>'EasemobController@noEasemob'));  					//查看本网站未注册环信用户列表
	Route::get('/groups', array('as'=>'easemob.groups', 'uses'=>'EasemobController@easemobGroups'));  				//查看本网站已注册环信圈子列表
	Route::get('/nogroups', array('as'=>'easemob.noeasemobgroups', 'uses'=>'EasemobController@noEasemobGroups'));  	//查看本网站未注册环信圈子列表
	Route::get('{id}/send', array('as'=>'easemob.send', 'uses'=>'EasemobController@send'));									//发送信息
	Route::post('/user/register', array('as'=>'easemob.register.user', 'uses'=>'EasemobController@accreditRegister'));  				//授权注册
	Route::post('/user/updatepass', array('as'=>'easemob.updatepass.user', 'uses'=>'EasemobController@updatePass'));  				//授权注册
	Route::post('/user/delete', array('as'=>'easemob.delete.user', 'uses'=>'EasemobController@deleteUsers'));  				//授权注册
	Route::post('/group/register', array('as'=>'easemob.register.group', 'uses'=>'EasemobController@accreditRegisterGroup'));  				//授权注册
	Route::get('/userdetails/{id}', array('as'=>'easemob.userdetails', 'uses'=>'EasemobController@userDetails'));  			//查看用户
	Route::get('/friend/list', array('as'=>'easemob.friend.list', 'uses'=>'EasemobController@listFriend'));  				//好友列表	
	Route::get('/friend/{id}/add', array('as'=>'easemob.addfriend', 'uses'=>'EasemobController@addFriend'));   				//添加好友
	Route::get('/friend/{id}/remove', array('as'=>'easemob.friend.remove', 'uses'=>'EasemobController@removeFriend'));		//删除好友
	Route::get('/group/list', array('as'=>'easemob.group.list', 'uses'=>'EasemobController@listGroups'));					//所有群组
	Route::get('/group/create', array('as'=>'easemob.group.create', 'uses'=>'EasemobController@createGroups'));				//创建群组
	Route::get('/group/{groupId}/detail', array('as'=>'easemob.group.detail', 'uses'=>'EasemobController@groupDetail'));	//群组详细
	Route::get('/group/{groupId}/edit', array('as'=>'easemob.group.edit', 'uses'=>'EasemobController@setGroups'));			//群组设置
	Route::get('/group/{groupId}/remove', array('as'=>'easemob.group.remove', 'uses'=>'EasemobController@removeDetail'));	//删除群组
	Route::get('/group/{groupId}/send', array('as'=>'easemob.group.send', 'uses'=>'EasemobController@send'));				//发送群组消息
	Route::get('/group/{groupId}/message', array('as'=>'easemob.message.list', 'uses'=>'EasemobController@chatRecord'));  	//消息记录
	Route::get('/group/{groupId}/users', array('as'=>'easemob.group.users', 'uses'=>'EasemobController@groupsUser'));		//群组成员
	Route::get('/group/{groupId}/add/{userId}', array('as'=>'easemob.group.add', 'uses'=>'EasemobController@addGroupsUser'));				//添加群组成员	
	Route::get('/group/{groupId}/remove/{userId}', array('as'=>'easemob.group.remove', 'uses'=>'EasemobController@removeGroupsUser'));		//删除群组成员	
});

//	定时同步任务
Route::group(array('befor' => array('auth','csrf'), 'prefix' => 'task'), function(){
	Route::post('/groupchat/back', array('as' => 'easemob.groupchat.back', 'uses' => 'QueueController@group_chat_backup'));		//备份圈子聊天记录
	Route::post('/question/autocomplete', array('as' => 'task.question.autocomplete', 'uses' => 'QueueController@autocomplete'));     //
});

// 静态补充页面
Route::get('aboutlv', array('as'=>'home.aboutlv','uses'=>'StaticController@aboutlv')); //关于律团
Route::get('about', array('as'=>'home.about','uses'=>'StaticController@about')); //关于我们
Route::get('career', array('as'=>'home.career','uses'=>'StaticController@career'));//加入律团
Route::get('privacy', array('as'=>'home.privacy','uses'=>'StaticController@privacy')); //法律声明
Route::get('contact', array('as'=>'home.contact','uses'=>'StaticController@contact'));//联系我们

Route::get('helper', array('as'=>'home.helper','uses'=>'HelpCenterStaticController@helper')); //新手上路
Route::get('beginner', array('as'=>'home.beginner','uses'=>'HelpCenterStaticController@beginner')); //新手上路
Route::get('lawyer_certification', array('as'=>'home.lawyer_certification','uses'=>'HelpCenterStaticController@lawyerCertification')); //律师认证
Route::get('common_problem', array('as'=>'home.common_problem','uses'=>'HelpCenterStaticController@commonProblem')); //常见问题
Route::get('ranking_strategy', array('as'=>'home.ranking_strategy','uses'=>'HelpCenterStaticController@rankingStrategy')); //排名攻略
Route::get('business_center', array('as'=>'home.business_center','uses'=>'HelpCenterStaticController@businessCenter')); //商务中心
Route::get('affiliate', array('as'=>'home.affiliate','uses'=>'HelpCenterStaticController@affiliate')); //友情链接
Route::get('media', array('as'=>'home.media','uses'=>'HelpCenterStaticController@media')); //求  报  道
Route::get('contribute', array('as'=>'home.contribute','uses'=>'HelpCenterStaticController@contribute')); //投稿


/*
|--------------------------------------------------------------------------
| 后台权限
|--------------------------------------------------------------------------
*/
Route::group(array('prefix' => 'admins', 'before' => 'admin_auth'), function()
{
    $Authority = 'AuthorityController@';
    # 退出
    Route::get('logout', array('as' => 'logout', 'uses' => $Authority.'getLogout'));
    Route::group(array('before' => 'guest'), function () use ($Authority) {
				# 登录
        Route::get('signin', array('as' => 'signin'        , 'uses' => $Authority.'getSignin'));
        Route::post('signin', $Authority.'postSignin');
    });

	# 员工管理
    Route::group(array('prefix' => 'users'), function () {
        $resource   = 'admin.users';
        $controller = 'Admin_UserResource@';
        Route::get(        '/{user_group_id}', array('as' => $resource.'.index'  , 'uses' => $controller.'users'  ));
		Route::get(   '/{id}/edit', array('as' => $resource.'.edit' , 'uses' => $controller.'edit' ));
        Route::get(   '/{id}/verify', array('as' => $resource.'.verify' , 'uses' => $controller.'verify'));
        Route::get(   '/{id}/recommend', array('as' => $resource.'.recommend' , 'uses' => $controller.'recommend'));
	    Route::get(   '/add/lawyer', array('as' => $resource.'.addlawyer' , 'uses' => $controller.'addLawyer'));
	    Route::get(   '/edit/lawyer/{id}', array('as' => $resource.'.editlawyer' , 'uses' => $controller.'editLawyer'));
	    Route::get(   '/delete/{id}', array('as' => $resource.'.deleteuser' , 'uses' => $controller.'delete'));
	    Route::post(   '/add/lawyer', array('as' => $resource.'.storelawyer' , 'uses' => $controller.'storeLawyer'));
	    Route::post(   '/edit/lawyer/{id}', array('as' => $resource.'.updatelawyer' , 'uses' => $controller.'updateLawyer'));
	});

	# 文章管理管理
    Route::group(array('prefix' => 'articles'), function () {
        $resource   = 'admin.article';
        $controller = 'Admin_ArticleResource@';
        Route::get(        '/', array('as' => $resource.'.index'  , 'uses' => $controller.'index'  ));
        Route::get(        '/lawyer', array('as' => $resource.'.from_lawyer.index'  , 'uses' => $controller.'fromLawyer'  ));
        Route::get(   '{id}/approve', array('as' => $resource.'.approve' , 'uses' => $controller.'approve' ));
        Route::get(   '{id}/unapprove', array('as' => $resource.'.unapprove' , 'uses' => $controller.'unapprove' ));
        Route::get('/create', array('as' => $resource.'.create'  , 'uses' => $controller.'create'  ));
        Route::post(   '/', array('as' => $resource.'.store' , 'uses' => $controller.'store' ));
        Route::get(   '{id}/view', array('as' => $resource.'.view' , 'uses' => $controller.'view' ));
        Route::get(   '{id}/edit', array('as' => $resource.'.edit' , 'uses' => $controller.'edit' ));
        Route::post(   '{id}/update', array('as' => $resource.'.update' , 'uses' => $controller.'update' ));
		Route::get('{id}/delete', array('as' => $resource.'.destroy', 'uses' => $controller.'destroy'));
	});
	# 文章类别管理
    Route::group(array('prefix' => 'article-class'), function () {
        $resource   = 'admin.article_class';
        $controller = 'Admin_ArticleClassController@';
        Route::get(        '/index', array('as' => $resource.'.index'  , 'uses' => $controller.'index'  ));
        Route::get('/create', array('as' => $resource.'.create'  , 'uses' => $controller.'create'  ));
        Route::post(   '/create', array('as' => $resource.'.store' , 'uses' => $controller.'store' ));
        Route::get(   '{id}/edit', array('as' => $resource.'.edit' , 'uses' => $controller.'edit' ));
        Route::post(   '{id}/update', array('as' => $resource.'.update' , 'uses' => $controller.'update' ));
		Route::delete('{id}', array('as' => $resource.'.destroy', 'uses' => $controller.'destroy'));
		});
	# 活动管理
    Route::group(array('prefix' => 'promotions'), function () {
        $resource   = 'admin.promotion';
        $controller = 'Admin_PromotionController@';
        Route::get(        '/', array('as' => $resource.'.index'  , 'uses' => $controller.'index'  ));
        Route::get('/create', array('as' => $resource.'.create'  , 'uses' => $controller.'create'  ));
        Route::post(   '/create', array('as' => $resource.'.store' , 'uses' => $controller.'store' ));
        Route::get(   '{id}/edit', array('as' => $resource.'.edit' , 'uses' => $controller.'edit' ));
        Route::post(   '{id}/edit', array('as' => $resource.'.update' , 'uses' => $controller.'update' ));
        Route::get(   '{id}/join', array('as' => 'admin.join.index' , 'uses' => $controller.'join' ));
        Route::get(   '{id}/join/edit', array('as' => 'admin.join.edit' , 'uses' => $controller.'editJoin' ));
        Route::post(   '{id}/join/edit', array('as' => 'admin.join.update' , 'uses' => $controller.'updateJoin' ));
		Route::delete('{id}', array('as' => $resource.'.destroy', 'uses' => $controller.'destroy'));
		});
    
     //商品
    Route::any('product/index', array('as'=>'admin.product.index', 'uses'=>'ProductController@index'));
    Route::any('product/edit/{id}', array('as'=>'admin.product.edit', 'uses'=>'ProductController@edit'));
    Route::any('product/add/', array('as'=>'admin.product.add', 'uses'=>'ProductController@add'));
    Route::any('product/drop/{id}', array('as'=>'admin.product.drop', 'uses'=>'ProductController@drop'));
	Route::any('product/cat-spec/{id}', array('as'=>'admin.product.cat_spec', 'uses'=>'ProductController@cat_spec') );
	//商品分类
	Route::any('product-category/index', array('as'=>'admin.product_category.index', 'uses'=>'ProductCategoryController@index'));
    Route::any('product-category/edit/{id}', array('as'=>'admin.product_category.edit', 'uses'=>'ProductCategoryController@edit'));
    Route::any('product-category/add', array('as'=>'admin.product_category.add', 'uses'=>'ProductCategoryController@add'));
    Route::any('product-category/drop/{id}', array('as'=>'admin.product_category.drop', 'uses'=>'ProductCategoryController@drop'));
	//商品属性
	Route::any('product-spec/index', array('as'=>'admin.product_spec.index', 'uses'=>'ProductSpecController@index'));
    Route::any('product-spec/edit/{id}', array('as'=>'admin.product_spec.edit', 'uses'=>'ProductSpecController@edit'));
    Route::any('product-spec/add', array('as'=>'admin.product_spec.add', 'uses'=>'ProductSpecController@add'));
    Route::any('product-spec/drop/{id}', array('as'=>'admin.product_spec.drop', 'uses'=>'ProductSpecController@drop'));
    Route::any('product-spec/{id}/option/index', array('as'=>'admin.product_spec.option.index', 'uses'=>'ProductSpecController@option_index'));
    Route::any('product-spec/{id}/option/add', array('as'=>'admin.product_spec.option.add', 'uses'=>'ProductSpecController@option_add'));
    Route::any('product-spec/{id}/option/edit/{option}', array('as'=>'admin.product_spec.option.edit', 'uses'=>'ProductSpecController@option_edit'));
    Route::any('product-spec/{id}/option/drop/{option}', array('as'=>'admin.product_spec.option.drop', 'uses'=>'ProductSpecController@option_drop'));
	//订单
	Route::any('order/index', array('as'=>'admin.order.index','uses'=>'OrderController@index') );
	Route::any('order/add', array('as'=>'admin.order.add','uses'=>'OrderController@add') );	
	Route::any('order/members', array('as'=>'admin.order.members', 'uses'=>'OrderController@members' ) ) ;
	Route::any('order/memaddr', array('as'=>'admin.order.memaddr', 'uses'=>'OrderController@memaddr' ) ) ;
	Route::any('order/products', array('as'=>'admin.order.products', 'uses'=>'OrderController@products' ) ) ;
	Route::any('order/update/{id}/{step}', array('as'=>'admin.order.update','uses'=>'OrderController@update') );	
});

/*
|--------------------------------------------------------------------------
| 后台管理
|--------------------------------------------------------------------------
*/
Route::get('admins', array('as' => 'dashboard', 'before'=>'admin_auth', 'uses' =>'DashboardController@index'));
Route::group(array('prefix' => 'admins', 'before'=>'admin_auth'), function () {
    # 后台首页
    Route::get('/', array('as' => 'admin.dashboard', 'uses' =>'DashboardController@index'));
    
    foreach ( ['circle','post'] as $controller){
    	foreach ( ['index'=>'', 'add'=>'', 'edit'=>'/{id}', 'remove'=>'/{id}','detail'=>'/{id}'] as $action=>$param ){
    		Route::any($controller.'/'.$action.$param, ['as'=>'admin.'.$controller.'.'.$action, 'uses'=> ucfirst($controller).'Controller@'.$action ]);
    	}
    }
    Route::any('circle/members/{id}', array('as'=>'admin.circle.members', 'uses'=>'CircleController@members') );
    Route::any('circle/member/{id}/setcreator/{user_id}', array('as'=>'admin.circle.member.setcreator', 'uses'=>'CircleController@setcreator') );
    Route::any('circle/member/{id}/setadmin/{user_id}', array('as'=>'admin.circle.member.setadmin', 'uses'=>'CircleController@setadmin') );
    Route::any('circle/member/{id}/remove/{user_id}', array('as'=>'admin.circle.member.remove', 'uses'=>'CircleController@delmember') );
    Route::any('circle/posts/{id}', array('as'=>'admin.circle.posts', 'uses'=>'CircleController@posts') );
    Route::any('circle/post/{id}/settop/{pid}', array('as'=>'admin.circle.post.settop', 'uses'=>'CircleController@settop') );
    Route::any('circle/post/{id}/setrecommend/{pid}', array('as'=>'admin.circle.post.setrecommend', 'uses'=>'CircleController@setrecommend') );
    Route::any('circle/post/{id}/remove/{pid}', array('as'=>'admin.circle.post.remove', 'uses'=>'CircleController@delpost') );
    Route::any('circle/post/{id}/detail/{pid}', array('as'=>'admin.circle.post.detail', 'uses'=>'CircleController@postDetail') );
    Route::any('post/{pid}/comment{cid}/remove', array('as'=>'admin.post.comment.remove','uses'=>'PostController@removeComment') );
    Route::any('post/settop/{id}', array('as'=>'admin.post.settop', 'uses'=>'PostController@settop') );
    Route::any('post/setrecommend/{id}', array('as'=>'admin.post.setrecommend', 'uses'=>'PostController@setrecommend') );

});

